
package com.zodiac.app.szse.configuration;

import com.github.lzm320a99981e.component.dataautomation.DataAutomationTemplate;
import com.github.lzm320a99981e.component.dataautomation.Extractor;
import com.github.lzm320a99981e.component.dataautomation.Processor;
import com.github.lzm320a99981e.component.dataautomation.Transfer;
import lombok.Data;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 自定义-应用配置
 */
@Data
@Configuration
@EnableConfigurationProperties(CustomizeApplicationProperties.class)
public class CustomizeApplicationConfiguration {

    private final CustomizeApplicationProperties properties;

    public CustomizeApplicationConfiguration(CustomizeApplicationProperties properties) {

        this.properties = properties;
    }

    @Bean
    public DataAutomationTemplate dataAutomationTemplate(List<Extractor> extractors, List<Processor> processors, List<Transfer> transfers) {
        DataAutomationTemplate template = new DataAutomationTemplate(extractors, processors, transfers);
        template.postConstruct();
        return template;
    }
}